package com.codinghero.example.longleg;

import java.io.File;

import com.codinghero.util.ImageUtils;

@SuppressWarnings("deprecation")
public class ClipMeinvTuanPic {

	public static void main(String[] args) {
		File origFolder = new File(Constant.ORIG.FOLDER_PATH);
		File destFolder = new File(Constant.ORIG.FOLDER_PATH + File.separator + "clip");
		if(!destFolder.exists())
			destFolder.mkdirs();
		File[] files = origFolder.listFiles();
		for (File file : files) {
			if (file.isFile() 
				&& file.length() > 30 * 1024
				&& 
				(file.getName().endsWith("jpg") || file.getName().endsWith("jpeg"))) {
				ImageUtils.clipUp(
						origFolder.getPath() + File.separator + file.getName(), 
						destFolder.getPath() + File.separator + file.getName(), 
						25);
			}
		}
	}

}
